import React from 'react'
import { useLocation } from 'react-router-dom'
export default function Detail() {
    /*
    const a = useLocation()
    console.log("@",a)
    const {id,title,describe} = a.state
    */
   //解构对象连继赋值
   const {state:{id,title,describe}} = useLocation()
    return (
        <div>
            <h2>{id}</h2>
            <h2>{title}</h2>
            <p>
                {describe}
            </p>
        </div>
    )
}
